<template>
  <Portlet title="仲裁信息">
    <el-form label-position="left" label-width="120px">
      <el-row :gutter="15">
        <el-col :span="24">
          <el-form-item label="仲裁客服：">
            <span>{{ arbitrationUserName }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="仲裁时间：">
            <span>{{arbitrationDate | unixTimestampFilter}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="仲裁说明：">
            <span>{{ arbitrationMemo }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="仲裁图片：">
            <upload-image :formData="{}" :value="getImage(arbitrationPic)" :readonly="true"></upload-image>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </Portlet>
</template>
<script>
import {dotData} from '@/utils'
import {unixTimestampFilter} from '@/filters'

export default {
  name: 'refundArbitration',
  components: {},
  filters: {
    unixTimestampFilter
  },
  props: {
    refundDetail: {
      type: Object,
      required: true
    }
  },
  computed: {
    arbitrationUserName() {
      return dotData(this.refundDetail, 'arbitrationUserName')
    },
    arbitrationDate() {
      return dotData(this.refundDetail, 'arbitrationDate')
    },
    arbitrationMemo() {
      return dotData(this.refundDetail, 'arbitrationMemo')
    },
    arbitrationPic() {
      return dotData(this.refundDetail, 'arbitrationPic')
    }
  },
  methods: {
    // 获取图片
    getImage(val) {
      if (Array.isArray(val)) {
        return val
      }
      if (typeof val === 'string' && val) {
        return val.split(',')
      }
      return []
    }
  }
}
</script>
